<?php

/* Your .htaccess file should direct page requests to this file */

/* Use of a namespace is required by teamug. Any name can be chosen */
namespace @@namespace@@;

/* Optional */
\ini_set('display_errors', 1);

/* Teamug will not start the session for you. So do it here yourself */
\session_start();

/* Get connected to teamug, and make friendly names for the classes */
require_once '@@path_to_teamug@@/Boot.php';
use \teamug\Project as project;
use \teamug\Dev as dev;
use \teamug\Config as config;
use \teamug\Session as session;
use \teamug\Mysqli as mysqli;

/* Get teamug to chatter away about what it is doing. Optional */
dev::setNarrationDestination(dev::NARRATE_TO_OUTPUT);
dev::$narration = true;
if (dev::$narration) { dev::narrate('App starting'); }

/* Start a new project. Tell teamug where to find your app's classes */
$prj = new project('@@namespace@@', __DIR__);
$prj->declareNamespace('foobar', __DIR__.'../foobar');

/* Values to use throughout your app, found in one place: here */
@@config@@

/* If this is the first call to your app, ensure all session vars are initialised */
@@session@@

/* Declare all the mysqli databases you will be using.
 * Note: No connections are made before the first SQL command is issued */
@@mysqli@@

/* From the URL, main() calls one of your RequestHandler classes, 
 * and returns it's Response object. */ 
$response = $prj->main();

// Now include whatever templates you want etc


